﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleSalesTrackingAPIWrapper
{
    public class Contacts
    {   
        // Get list of all Contacts
        public static List<SimpleSalesTrackingAPI.Contact> GetContacts(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return new List<SimpleSalesTrackingAPI.Contact>(api.GetContacts(username, password));
        }

        // Get a single contact, by contactId
        public static SimpleSalesTrackingAPI.Contact GetContactById(string username, string password, int contactId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.GetContactById(username, password, contactId);
        }

        // Insert a new Contact
        public static int InsertContact(string username, string password, SimpleSalesTrackingAPI.Contact contact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.InsertContact(username, password, contact);
        }

        // Insert a new Contact
        public static int InsertContact(string username, string password, string firstName, string lastName, string jobTitle, string company, string email, string website,
            string phone, string fax, string mobile, string address, string city, string province, string postalCode, string country,
            string billingAddress, string billingCity, string billingProvince, string billingPostalCode, string billingCountry,
            string notes)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.InsertContact2(username, password, firstName, lastName, jobTitle, company, email, website,
            phone, fax, mobile, address, city, province, postalCode, country,
            billingAddress, billingCity, billingProvince, billingPostalCode, billingCountry, notes);
        }

        // Update an existing Contact
        public static int UpdateContact(string username, string password, SimpleSalesTrackingAPI.Contact contact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.UpdateContact(username, password, contact);
        }

        // Update an existing Contact
        public static int UpdateContact(string username, string password, int contactId, string firstName, string lastName, string jobTitle, string company, string email, string website,
            string phone, string fax, string mobile, string address, string city, string province, string postalCode, string country,
            string billingAddress, string billingCity, string billingProvince, string billingPostalCode, string billingCountry,
            string notes)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.UpdateContact2(username, password, contactId, firstName, lastName, jobTitle, company, email, website,
            phone, fax, mobile, address, city, province, postalCode, country,
            billingAddress, billingCity, billingProvince, billingPostalCode, billingCountry, notes);
        }

        // Delete an existing Contact
        public static int DeleteContact(string username, string password, SimpleSalesTrackingAPI.Contact contact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.DeleteContact(username, password, contact);
        }

        // Delete an existing Contact
        public static int DeleteContact(string username, string password, int contactId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();

            return api.DeleteContact2(username, password, contactId);
        }

    }
}
